﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CAGFIP.Edicao;
using CAGFIP.Jogo;

namespace CAGFIP.GUI
{
    public class Ranking : Panel
    {

        #region Properties

        public DataGridView Rank
        {
            get { return this.ranking; }
        }

        #endregion

        public Ranking()
        {
            this.Dock = DockStyle.Fill;
            this.Location = new System.Drawing.Point(0, 0);
            initComponents();
        }

        private void initComponents()
        {
            ranking = new DataGridView();
            ((System.ComponentModel.ISupportInitialize)(ranking)).BeginInit();

            screenTitle = new Label();
            screenTitle.AutoSize = true;
            screenTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            screenTitle.Location = new System.Drawing.Point(338, 9);
            screenTitle.Size = new System.Drawing.Size(135, 25);
            screenTitle.Text = "Ranking Geral";

            dificuldadeLabel = new Label();
            dificuldadeLabel.AutoSize = true;
            dificuldadeLabel.Location = new System.Drawing.Point(162, 400);
            dificuldadeLabel.Size = new System.Drawing.Size(135, 25);
            dificuldadeLabel.Text = "Dificuldade:";

            dificuldade = new ComboBox();
            dificuldade.Location = new System.Drawing.Point(300, 400);
            dificuldade.Size = new System.Drawing.Size(221, 21);
            dificuldade.FormattingEnabled = false;
            dificuldade.DropDownStyle = ComboBoxStyle.DropDownList;
            foreach (var el in System.Enum.GetValues(typeof(DificuldadeCode)))
            {
                dificuldade.Items.Add(el);
            }
            dificuldade.SelectedIndexChanged += new EventHandler(dificuldade_SelectedIndexChanged);


            sairRanking = new Button();
            sairRanking.Location = new System.Drawing.Point(377, 519);
            sairRanking.Size = new System.Drawing.Size(75, 23);
            sairRanking.TabIndex = 1;
            sairRanking.Text = "Sair";
            sairRanking.UseVisualStyleBackColor = true;
            sairRanking.Click += new EventHandler(sairRanking_Click);

            ranking.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            ranking.Location = new System.Drawing.Point(162, 105);
            ranking.Size = new System.Drawing.Size(460, 242);
            ranking.TabIndex = 0;
            ranking.ReadOnly = true;
            ranking.AllowUserToAddRows = false;
            ranking.AllowUserToDeleteRows = false;
            ranking.AllowUserToResizeColumns = false;
            ranking.AllowUserToResizeRows = false;



            this.Controls.Add(screenTitle);
            this.Controls.Add(dificuldadeLabel);
            this.Controls.Add(dificuldade);
            this.Controls.Add(sairRanking);
            this.Controls.Add(ranking);

            ((System.ComponentModel.ISupportInitialize)(ranking)).EndInit();
        }

        void dificuldade_SelectedIndexChanged(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        void sairRanking_Click(object sender, EventArgs e)
        {
            ControladorGUI.Instance.ExibirMenuInicial();
        }

        private Label screenTitle;
        private Label dificuldadeLabel;
        private ComboBox dificuldade;
        private Button sairRanking;
        private DataGridView ranking;
    }
}
